<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>井石管理平台</title>

    <!-- Bootstrap core CSS -->
    <link href="__STATIC__/css/bootstrap.css" rel="stylesheet">

    <!-- Add custom CSS here -->
    <link href="__STATIC__/css/sb-admin.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/font-awesome/css/font-awesome.min.css">

        <!-- 导出引用 -->
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/Ext/styles.css"/>
    <!-- <link rel="stylesheet" type="text/css" href="__PUBLIC__/Ext/bootstrap.css"/> -->
    <script type="text/javascript" src="__PUBLIC__/Ext/jquery.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Ext/bootstrap.min.js"></script>
 <!-- 编辑器 -->
    <script type="text/javascript" src="__PUBLIC__/ueditor/third-party/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="__PUBLIC__/ueditor/ueditor.all.js"></script>
  
 <script type="text/javascript" charset="utf-8">
        window.UEDITOR_HOME_URL = "__PUBLIC__/ueditor/";
        window.onload=function(){
          window.UEDITOR_CONFIG.initialFrameHeight=250;//自由设置宽
          window.UEDITOR_CONFIG.initialFrameWidth=600;//自由设置高
          var ue = UE.getEditor('editor');
        }

</script>

</head>

<body>

  <div id="wrapper">

      <!-- Sidebar -->
      <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
          <!-- Brand and toggle get grouped for better mobile display -->
          <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                  <span class="sr-only">Toggle navigation</span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
                  <span class="icon-bar"></span>
              </button>
              <a class="navbar-brand" href="{:U('Ent/index')}">井石管理平台</a>
          </div>

          <!-- Collect the nav links, forms, and other content for toggling -->
          <div class="collapse navbar-collapse navbar-ex1-collapse">

              <ul class="nav navbar-nav side-nav">
                <li class="dropdown">
                    <a href="{:U('Ent/index')}"><i class="fa fa-reorder"></i> 数据列表</a>
                </li>
                <li class="dropdown addueditor">
                    <a id="fa-edit" style="cursor:pointer"><i class="fa fa-edit"></i> 添加管理</a>
                    
                </li>
                <li class="dropdown">
                    <a href="{:U('Ent/upd')}"><i class="fa fa-users"></i> 修改密码</a>  
                 </li>

              </ul>

              <ul class="nav navbar-nav navbar-right navbar-user">

                  <li class="dropdown user-dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> 你好,{:session('username')} <b class="caret"></b></a>
                      <ul class="dropdown-menu">
                          
                          <li><a href="{:U('login/logout')}"><i class="fa fa-power-off"></i> 退出</a></li>
                      </ul>
                  </li>
              </ul>
          </div><!-- /.navbar-collapse -->
      </nav>

  <div id="page-wrapper">

      <div class="from-content">

              <if condition="$type eq 4">
                <div class="add"  id="add1">
                    <form action="{:U('Index/modify')}" method='POST' enctype='multipart/form-data'>
                        <label style="margin-left:48%;">新服名称</label>
                        <input type="text" name="newname"  value="{$up.newname}" class="form-control" style="margin-left:40%;margin-top:5em; width:20em"><br><br><br>
                        <input type="text" name="list" value="server" style="display: none;" >
                        <input type="text" name="listRows" value="{$up.id}" style="display: none;" >
                        <button type="submit" class="btn-default1"  style="margin-left:48%;">确认修改</button>
                    </form>
                </div>
              </if>

              <if condition="$type eq 2">
                <div class="add"  id="add2">
                    <form action="{:U('Ent/uplode')}" method='POST' enctype='multipart/form-data'>
                        <label style="margin-left:43%;">添加图鉴图片</label><br>
                        <span style="width:200px;margin-left:30%;">
                            <img src="{$up.img}" alt="" style="width:200px;">
                            <img src="{$up.big_img}" alt="" style="width:200px;"><br>
                          <p style="font-size: 13px;color:red;margin-left:33%;">提示：已添加显示图片 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提示：已添加详情图片</p>
                      
                        </span>
                        <input type="text" name="list" value="list" style="display: none;" >
                        <input type="text" name="listRows" value="{$up.id}" style="display: none;" >
                        <input type="file" name="photo[]" multiple="multiple" style="margin-left:42%;margin-top:2em; width:20em"> <p style="font-size: 13px;color:red;margin-left:35%;"><br>提示:第一张上传星级宠物图片,第二张上传星级宠物详情图片</p>
                        <br><br>
                        <label style="margin-left:43%;">选择星级</label>
                        <select name="cont" >
                          <option value ="1" <if  condition="$up.status eq 1">selected = "selected"</if>>1星</option>
                          <option value ="2" <if  condition="$up.status eq 2">selected = "selected"</if>>2星</option>
                          <option value="3" <if  condition="$up.status eq 3">selected = "selected"</if>>3星</option>
                          <option value="4" <if  condition="$up.status eq 4">selected = "selected"</if>>4星</option>
                        </select>
                         <br><br><br>

                        <button type="submit" class="btn-default2" style="margin-left:43%;">确认修改</button>
                    </form>
                  </div>
                </if>
                <if condition="$type eq 1">
                  <div class="add"  id="add3" style="margin-top:3em;">
                     <form action="{:U('Index/modify')}" method='POST' enctype='multipart/form-data'>
                        
                            <label style="margin-left:47%">新闻标题</label> <br>
                            <input type="text" name="title" class="form-control" value="{$up.title}" style="margin-left:40%; width:20em">
                            <input type="text" name="list" value="jour" style="display: none;" >
                            <input type="text" name="listRows" value="{$up.id}" style="display: none;" >
                            <br>
                            <label style="margin-left:45%">选择新闻状态</label>
                            <select name="num" >
                              <option value="1" <if  condition="$up.status eq 1">selected = "selected"</if>>最新</option>
                              <option value ="2" <if  condition="$up.status eq 2">selected = "selected"</if>>新闻</option>
                              <option value ="3" <if  condition="$up.status eq 3">selected = "selected"</if>>公告</option>
                            </select>
                             <br><br>
                             <label style="margin-left:45%;">新闻详情内容</label><br>
                            <textarea name="editor" id="editor" runat="server" style="margin-left:28%;">{$up.content}</textarea>
                            <br>
                            <button type="submit" class="btn-default2" style="margin-left:45%;">确认修改</button>
                      </form>
                  </div>
                </if>
                <if condition="$type eq 3  OR $type eq 5">
                  <div class="add"  id="add4" style="margin-top:2em;">
                        <form action="{:U('Ent/uplode')}" method='POST' enctype='multipart/form-data'>
                            <label style="margin-left:45%;">活动、攻略图片</label><br><br>
                            <p style="font-size: 13px;color:red;margin-left:42%;">
                              <span>
                                <img src="{$up.img}" alt="" style="width:200px;font-size: 13px;color:red;">提示:已上传图片<br>
                
                              </span>
                           </p>
                           <input type="text" name="list" value="ctivity" style="display: none;" >
                            <input type="text" name="listRows" value="{$up.id}" style="display: none;" >
                            <input type="file" id="activity_img" name="activity_img" style="margin-left:40%; width:20em"> 
                              <p style="font-size: 13px;color:red;margin-left:42%;"><br>提示:添加最新活动或者游戏攻略图片</p><br>
                            <label style="margin-left:45%;">活动、攻略标题</label> <br>
                            <input type="text" id="activity" name="title" value="{$up.title}" class="form-control" style="margin-left:40%; width:20em">
                            <br>
                            <label style="margin-left:45%;">选择状态</label>
                            <select name="number">
                              <option value="1">最新活动</option>
                              <option value ="2">游戏攻略</option>
                            </select>
                             <br><br>
                             <label style="margin-left:45%;">活动、攻略的详情内容</label><br><br>
                            <textarea name="editor" id="editor"  runat="server" style="margin-left:28%;">{$up.content}</textarea>
                            <br><br>
                            <button type="submit" class="btn-default2" style="margin-left:50%;" >确认修改</button>
                        </form>   
                  </div>
                </if>
                 
  </div>
<include file="Public/footer" />

<script type="text/javascript">

//编辑器传参
 function uptext(obj){
            var ueditor='';
            var num='';
            var title='';
           ueditor = UE.getEditor('editor').getContent();
           title = $('#add3 input').val();
           num = $('#add3 select').val();
            $.ajax({
                url: "index.php?m=Admin&c=Ent&a=addAdmin",
                type: 'POST',
                data: {
                   'ueditor':ueditor,'num':num,'title':title,
                },
                dataType: "JSON",
                success: function (data) {
                    if(data.result==1){
                    alert(data.msg);
                    history.go(0)
                    }
                    if(data.result==0){
                        alert(data.msg);
                    }
                }
            });
        }
        $('.dropdown-toggle').click(function(){
          $('.dropdown-menu').show();

     })

</script>
